<?php

	class cmd_brand extends mdl_brand
	{
		/* 根据品牌ID取得所属的分类ID */
		function getCatByBrandId($brand_id)
		{
			if (is_array($brand_id))
			{
				$implode_brand = '('.implode(',',$brand_id).')';
				$sqlString = 'SELECT cat_id FROM '.DB_PREFIX.'goods WHERE brand_id in '.$brand_id.' GROUP BY cat_id';
				$cat_list = $this->db_select($sqlString);
			}
			else
			{
				$sqlString = 'SELECT cat_id FROM '.DB_PREFIX.'goods WHERE brand_id=\''.$brand_id.'\' GROUP BY cat_id';
				$cat_list = $this->db_select($sqlString);
			}
		}
	}

?>